package com.fdq.dianping.controller;

import com.fdq.dianping.entity.Result;
import com.fdq.dianping.util.AliOss;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

/*
* 用于给oss上传文件、图片
* */

@RestController
@RequestMapping("/file")
public class FileController {

    /*
    * 上传图片
    * */
    @PostMapping("/uploadImage")
    public String uploadImage(List<MultipartFile> images) {
        String upload = AliOss.uploadPic(images);
        return upload;
    }
}
